package com.ooono.factorytest.items;

import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.ooono.factorytest.R;
import com.ooono.factorytest.base.BaseActivity;

import mcs8.mdm.PolicyManager;

public class RebootTestActivity extends BaseActivity {

    public static final String KEY = "reboot";

    @Override
    public int getContentLayout() {
        return R.layout.content_reboot_test;
    }

    @Override
    public void initViews() {
        Button shutdownBtn = findViewById(R.id.btn_shutdown);
        shutdownBtn.setOnClickListener(v -> PolicyManager.shutdownDevice());
        Button rebootBrn = findViewById(R.id.btn_reboot);
        rebootBrn.setOnClickListener(v -> PolicyManager.rebootDevice());
    }

    @Override
    public int getTestTitle() {
        return R.string.test_item_reboot;
    }

    @Override
    public String getTestKey() {
        return KEY;
    }

    @Override
    protected void onResume() {
        super.onResume();
        bottomButtonCl.setVisibility(View.GONE);
    }

    @Override
    protected void onStop() {
        super.onStop();
        bottomButtonCl.setVisibility(View.VISIBLE);
    }
}
